//
//  CNThemeableViewController.m
//  MultiTheme
//
//  Created by Charith Nidarsha on 5/30/14.
//  Copyright (c) 2014 Charith Nidarsha. All rights reserved.
//

#import "CNThemeableViewController.h"

@interface CNThemeableViewController ()

@end

@implementation CNThemeableViewController

- (id) initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self)
    {
        // Custom initialization
    }
    return self;
}

- (void) viewDidLoad
{
    [super viewDidLoad];
    
    //This view controller is now listening to Theme change events.
    [CNMultiThemeManager registerForThemeChange:self];
}

- (void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
}

- (void) viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
}

- (void) didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    
    //this will clear the cached objects from memroy
    [CNMultiThemeManager respondsToMemoryWarnings];
}

#pragma mark - ThemeableDelegate method
- (void) applyTheme
{
    NSLog(@"Applying theme in the %@ class", NSStringFromClass(self.class));
}

@end
